import Mock from 'mockjs'

Mock.mock('/api/login', 'post', {
  'success|2-8': false,
  msg: '',
  'token|10-17': '@string'
})

Mock.mock('/api/user/info', {
  success: true,
  msg: '',
  role: '@name'
})
Mock.mock(/\/api\/user\/list(\?.*)?/, {
  success: true,
  msg: '',
  total: '@integer(10, 50)',
  'users|10': [{
    // 'ID|+1': 1,
    username: '@id',
    fullname: '@cname',
    role: 'student',
    'state|1-9': false,
    'mobile|1': '@integer(1,5)'
  }]
})
// Mock.mock('/api/user/info', () => mock({
//   success: true,
//   msg: '',
//   obj: {
//     account_name: '@name',
//     'gender|1': ['male', 'female'],
//     birthday: Mock.Random.datetime('yyyy-MM-dd'),
//     address: 'a b c d'
//   }
// }))
